// 房东相关请求

import { DataListParams, ResultData, DeleteParams, CheckParams } from './model'
import { defHttp } from '/@/utils/http/axios'
import { ErrorMessageMode } from '/@/utils/http/axios/types'

enum Api {
    dataListUrl = '/reports/list',
    deleteUrl = '/reports/delete',
    checkUrl = '/reports/check',
}

/**
 * @description: 列表
 */
export function dataListApi(params: DataListParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request<ResultData>(
        {
            url: Api.dataListUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}

/**
 * @description: 删除
 */
export function deleteApi(params: DeleteParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.deleteUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}
/**
 * @description: 处理
 */
export function checkApi(params: CheckParams, mode: ErrorMessageMode = 'modal') {
    return defHttp.request(
        {
            url: Api.checkUrl,
            method: 'POST',
            params,
        },
        {
            errorMessageMode: mode,
        }
    )
}
